//
//  MainTabBarController.swift
//  EasyTrademarkRegqurySearch
//
//  Created by 伊伊 on 2024/2/27.
//

import UIKit

class MainTabBarController: UITabBarController,UITabBarControllerDelegate{

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        
        self.view.backgroundColor = .white
        
        self.setUpChildVc(vc: HomeController(), title: "首页", normalImageName: "tab_home_normal", selectImageName: "tab_home_sel")
        
//        //self.setUpChildVc(vc: OrderController(), title: "订单", normalImageName: "", selectImageName: "")
//        
        self.setUpChildVc(vc: MineController(), title: "我的", normalImageName: "tab_mine_normal", selectImageName:"tab_mine_sel")
        self.delegate = self
        
    }
    private func setUpChildVc(vc:UIViewController ,title:String,normalImageName:String,selectImageName:String){
        vc.title = title
        vc.tabBarItem.image = UIImage(named:normalImageName)?.withRenderingMode(.alwaysOriginal)
        vc.tabBarItem.selectedImage = UIImage(named: selectImageName)?.withRenderingMode(.alwaysOriginal)
        let na = BaseNavigationController(rootViewController: vc)
        self.addChild(na)
    }
    func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
       
        return true
    }
}
